package com.zlx.mall.basic.web.service;

import org.jetbrains.annotations.Nullable;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestClientResponseException;

/**
 * @author qingke
 **/
public interface IHttpLogService {

    /**
     * Safe save log
     *
     * @param code              code
     * @param requestTimestamp  requestTimestamp
     * @param requestEntity     RequestEntity
     * @param responseTimestamp responseTimestamp
     * @param responseEntity    ResponseEntity
     */
    void safeSaveLog(String code,
                     Long requestTimestamp,
                     RequestEntity<?> requestEntity,
                     Long responseTimestamp,
                     @Nullable ResponseEntity<?> responseEntity);

    /**
     * Safe save log
     *
     * @param code                        code
     * @param requestTimestamp            requestTimestamp
     * @param requestEntity               RequestEntity
     * @param responseTimestamp           responseTimestamp
     * @param restClientResponseException RestClientResponseException
     */
    void safeSaveLog(String code,
                     Long requestTimestamp,
                     RequestEntity<?> requestEntity,
                     Long responseTimestamp,
                     RestClientResponseException restClientResponseException);
}
